package com.donghu;
import java.io.*;

public class B {

    public void write(String str) {

        A a = new A();
        try {
            BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(a.getTMP()));// 打开路径文件
            bufferedWriter.write(str);// 写入信息
            bufferedWriter.close();// 关闭文件并保存

        } catch (IOException e) {
            System.out.println(e);
        }

        System.out.println("成功改写。文件内容变更为：" + str);
    }
}
